<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="/Public/frame/layui/css/layui.css">
	    <!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
	    <link rel="stylesheet" href="/Public/frame/static/css/style.css">
	    <link rel="icon" href="/Public/frame/static/image/code.png">
	</head>
	<body>
		<a href="<?php echo U('lst')?>" class="layui-btn" style="margin-top: 10px; "><i class="layui-icon">&#xe603;</i>角色列表</a>
		<a class="layui-btn btn-add btn-default" id="btn-refresh"style="margin-top: 10px;"><i class="layui-icon">&#x1002;</i></a>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
          <legend style="font-size: 14px;">修改角色</legend>
        </fieldset>
		<form class="layui-form layui-form-pane" action="/index.php/Hawk/Role/edit/id/13.html" method="post">
			<input type="hidden" name="id" value="<?php echo $data['id']; ?>" />
			<div class="layui-form-item">
                <label class="layui-form-label">上级角色</label>
                <div class="layui-input-inline">
                  <select name="pid" lay-filter="aihao">
                        <option value="0">顶级</option>
<?php foreach ($role as $k => $v): if($v['id']==$data['pid']) $select='selected="selected"'; else $select=''; ?>
                        <option <?php echo ($select); ?> value="<?php echo ($v['id']); ?>"><?php echo ($v['role_name']); ?></option>
<?php endforeach;?>
                    </select>
                </div>
            </div>
			<div class="layui-form-item">
			    <label class="layui-form-label">角色名称</label>
			    <div class="layui-input-inline">
			      <input type="text" name="role_name" lay-verify="required" placeholder="请输入" autocomplete="off" value="<?php echo ($data['role_name']); ?>" class="layui-input">
			    </div>
			</div>
			
			<div class="layui-form-item" pane="">
			    <label class="layui-form-label">权限内容</label>
			    <div class="layui-input-block">
			      <?php foreach($arr as $v): if($rparr && in_array($v['id'],$rparr)){ $check = 'checked="checked"'; }else{ $check = ''; } ?>
                    <?php echo str_repeat('—',6*$v['level']);?><input  title="<?php echo ($v["pri_name"]); ?>" level="<?php echo ($v["level"]); ?>" <?php echo ($check); ?> type="checkbox" name="pri_id[]" 
                    value="<?php echo ($v["id"]); ?>" /><br/>
                <?php endforeach?>
			     	      
			    </div>
			</div>
			
			<div class="layui-form-item">
			    <div class="layui-input-block">
			      <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
			      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
			    </div>
			</div>
		</form>	
		
	</body>
<script type="text/javascript" src="/Public/frame/layui/layui.js"></script>
	<script>
layui.use(['form','layer','jquery','layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,    $ = layui.jquery
  ,layedit = layui.layedit
  ,laydate = layui.laydate;

  $('#btn-refresh').on('click', function () {
            location.reload();
        });
  
});
	</script>
</html>